package org.darkforest.ucenter.service.impl;

import org.darkforest.dao.mapper.MemberMapper;
import org.darkforest.model.Member;
import org.darkforest.ucenter.service.MemberAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * Created by valentina on 15/6/16.
 */
@Service
public class MemberAccountServiceImpl implements MemberAccountService {
    @Autowired
    private MemberMapper memberMapper;

    @Override
    public int updateMemberPoint(Integer memberId, Integer points,Integer freezePoints) {
        Member member = new Member();
        member.setMemberId(memberId);
        if(points!=null){
            member.setMemberPoints(points);
        }
        if(freezePoints!=null){
            member.setFreezePoints(freezePoints);
        }
        return memberMapper.updateMemberPoints(member);
    }
}
